#include "scImlcd.h"

extern char *pImCmd;
int fImInitLcd()
{
    // Alphanumeric LCD initialization
    // Connections specified in the
    // Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
    // RS - PORTC Bit 5
    // RD - PORTC Bit 6
    // EN - PORTC Bit 4
    // D4 - PORTC Bit 0
    // D5 - PORTC Bit 1
    // D6 - PORTC Bit 2
    // D7 - PORTC Bit 3
    // Characters/line: 16
    lcd_init(16);            
    
    lcd_gotoxy(0,0);
    lcd_puts("Judul Alat");
    lcd_gotoxy(0,1);
    lcd_puts("Judul alat/Nama");                   
    
    return 0;
}

int fImSendLcd(char *cImPar)
{
    unsigned char x,y;  
    pImCmd = strtok(cImPar," ");
    x = *pImCmd - 0x30;  
    pImCmd = strtok(NULL," ");
    y = *pImCmd - 0x30;         
    lcd_gotoxy(x,y);
    pImCmd = strtok(NULL,"\0");   
    lcd_puts(pImCmd);
    return 0;
}
